package com.ucode.application.form.sys;

import java.io.Serializable;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Length;

import com.ucode.springboot.starter.web.validator.annotation.CheckMember;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@SuppressWarnings("serial")
@ApiModel(value="数据权限->角色权限")
public class DataRoleModuleItem implements Serializable{
    
    @ApiModelProperty(value = "模块代码",required=true)
    @NotBlank(message = "模块代码不能为空")
    @Length(max=100,message = "模块代码最大100字符")
    private String moduleCode;
    
    @ApiModelProperty(value = "权限类型:1、本人，2、本人及下属，3、本部门，4、本部门及下属部门，5 指定部门(含本人),6指定部门及下属部门(含本人)，100全部",required=true,example="1")
    @CheckMember(value={"1","2","3","4","5","6","100"},message="数据权限类型非法")
    private Integer permissionType;
    
    @ApiModelProperty(value = "限部门Ids(只有readType = 5或6时有效)",required=false)
    @Size(max=10,message="指定部门最大可以选择10个部门")
    private List<Long> deptIds;
    
    
    public String getModuleCode() {
        return moduleCode;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }

    public Integer getPermissionType() {
        return permissionType;
    }

    public void setPermissionType(Integer permissionType) {
        this.permissionType = permissionType;
    }

    public List<Long> getDeptIds() {
        return deptIds;
    }

    public void setDeptIds(List<Long> deptIds) {
        this.deptIds = deptIds;
    }
}